<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.csc.data.BookObj" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
	<h2>Book Store</h2>
	<jsp:useBean id="bookList" class="java.util.ArrayList"></jsp:useBean>
	<%  bookList = (ArrayList<BookObj>) request.getAttribute("bookStore"); %>
	<table border="1">
	<% for(int i = 0; i< bookList.size(); i++){ 
		out.println("<tr>");
		out.println("<td>");
		out.print(((BookObj) bookList.get(i)).getTitle());
		out.println("</td>");
		out.println("<td>");
		out.println("<a  href='/Test_JCS/BookDetailServlet?bookId=" + ((BookObj) bookList.get(i)).getBookId()+ 
				"'> View Detail </a>");
		out.println("</td>");
		out.println("</tr");
	}%> 
	</table>
</body>
</html>